package com.lvmama.pangolin.mybatis.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.lvmama.pangolin.entity.ProductConditionVO;
import com.lvmama.pangolin.entity.RelevanceProduct;

public interface RelevanceProductMapper {
	/**
	 * 
	 * @param product
	 * 进行关联并入表
	 */
	public void insertXC(RelevanceProduct product);
	public void insertTN(RelevanceProduct product);
	public void insertTC(RelevanceProduct product);
	public void insertQNR(RelevanceProduct product);
	public void insertEL(RelevanceProduct product);
	//增加美团
	public void insertMT(RelevanceProduct product);
	/**
	 * 
	 * @param product
	 * 删除关联
	 */
	public void deleteXC(RelevanceProduct product);
	public void deleteTN(RelevanceProduct product);
	public void deleteTC(RelevanceProduct product);
	public void deleteQNR(RelevanceProduct product);
	public void deleteEL(RelevanceProduct product);
	//增加美团
	public void deleteMT(RelevanceProduct product);
	/**
	 * 
	 * @param product
	 * 更新关联表
	 */
	public void updateXC(RelevanceProduct product);
	public void updateTN(RelevanceProduct product);
	public void updateTC(RelevanceProduct product);
	public void updateQNR(RelevanceProduct product);
	public void updateEL(RelevanceProduct product);
	//增加美团
	public void updateMT(RelevanceProduct product);
	public void updateRelevance(RelevanceProduct product);
	/**
	 * 
	 * @param productId
	 * @return
	 * 根据productId查询已经关联的产品
	 */
	public RelevanceProduct viewRelevance(@Param("productId")String productId,@Param("businessCode")String businessCode);
	
	/**
	 * 查询所有已经关联的产品
	 */
	public List<RelevanceProduct> viewAllRelevance(ProductConditionVO po);

	public List<RelevanceProduct> allRelevance();
	public List<RelevanceProduct> findByMap(Map<String,String> paramMap);
	public List<String> findNameByRelProdId(@Param("businessCode")String businessCode,@Param("companyCode")String companyCode,@Param("prodIdRel")String prodIdRel);

	/**
	 * 根据具product筛选查询具有的产品数量
	 * @param product
	 * @return
	 */
	public int queryCountByRelprodid(RelevanceProduct product);
}
